package news.dao;

import news.util.BaseDao;

public class AddTopicDaoImpl implements IAddTopicDao{
    //mysql baseDao
    //oracle baseDao
    private BaseDao baseDao = new BaseDao();
    @Override
    public void addTopic(String topicName) {
        try {
            baseDao.openDB();
            String sql = "INSERT INTO news_topic(topicname) values(?)";
            baseDao.ps = baseDao.conn.prepareStatement(sql);
            baseDao.ps.setString(1,topicName);
            baseDao.ps.execute();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
